package pam.sample;

import java.util.List;

import pam.lang.XMLObject;
import pam.security.Permission;
import pam.web.AbstractPamlet;
import pam.web.WebException;
import pam.web.XMLObjectList;

class QueryBooksPamlet extends AbstractPamlet {

	public Permission getPermission() {
		return null;
	}

	protected XMLObject run() throws WebException {

		BookManager manager = new BookManager();
		List list = manager.getBooks();
		if (list == null || list.size() <= 0)
			return null;

		return new XMLObjectList(list);
	}

}
